<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
  <style>
    .paging_simple_numbers{text-align:center;margin-top:20px;margin-bottom: 20px;}
    .paging_simple_numbers .pagination li{margin:0px 10px; border:1px solid #e6e6e6;padding: 3px 8px;display: inline-block;}
    .paging_simple_numbers .pagination .active{background-color: rgba(35,162,219,0.98);color: #fff;}
    .paging_simple_numbers .pagination .disabled{color:#aaa;}
  </style>

  {include file="public/header"/}
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong class="icon-reorder"> 内容列表</strong></div>
  <div class="padding border-bottom">
  <button type="button" class="button border-yellow" onclick="window.location.href='#add'"><span class="icon-plus-square-o"></span> 添加内容</button>
    <form action="" method="get">
      <input type="text" name="brand_name" placeholder="请搜索品牌名称" value="<{$data['brand_name']|default=''}>">
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <span>是否推荐</span>
      &nbsp;&nbsp;&nbsp;
      <lable><input type="radio" name="if_show" value="2" checked>全部</lable>
      <lable><input type="radio" name="if_show"  value="1" {eq name="data['if_show']|default=''" value="1"}checked{/eq}>是</lable>
      <lable><input type="radio" name="if_show" value="0" {eq name="data['if_show']|default=''" value="0"}checked{/eq}>否</lable>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <span>是否有图</span>
      &nbsp;&nbsp;&nbsp;
      <lable><input type="checkbox" name="brand_logo[]" value="1" {in name="1" value="$data['brand_logo']|default=[]"}checked{/in}>是</lable>
      <lable><input type="checkbox" name="brand_logo[]" value="0" {in name="0" value="$data['brand_logo']|default=[]"}checked{/in}>否</lable>
      <button>搜索</button>
    </form>
  </div>
  <table class="table table-hover text-center">
    <tr>
      <th width="10%">序号</th>
      <th width="20%">品牌名称</th>
      <th width="15%">类别</th>
      <th width="20%">图片LOGO</th>
      <th width="10%">排序</th>
      <th width="15%">推荐</th>
    </tr>
    {volist name="arr" id="v" empty="$empty"}
      <tr>
        <td style="text-align:left; padding-left:20px;"><input type="checkbox" name="id[]" class="brand_id" value="<{$v['brand_id']}>" /><{$v['brand_id']}></td>
      <td><{$v['brand_name']}></td>
      <td><{$v['tag']}></td>
        <td width="10%">
          {empty name="v['brand_logo']"}
          <img src="__STATIC__/data/default.png" alt="" width="70" />
          {else /}
          <img src="/storage/<{$v['brand_logo']}>" alt="" width="70" />
          {/empty}
        </td>
        <td><{$v['sort_order']}></td>
        <td><{$v['if_showzn']}></td>
      <td><div class="button-group">
      <a class="button border-main" href="<{:url('edit_brand',['id'=>$v['brand_id'],'param'=>$Request.param])}>"><span class="icon-edit"></span> 修改</a>
      <a class="button border-red" href="<{:url('del',['id'=>$v['brand_id']])}>" onclick="return del(1,1)"><span class="icon-trash-o"></span> 删除</a>
      </div></td>
    </tr>
    {/volist}
    <td style="text-align:left; padding:19px 0;padding-left:20px;"><input type="checkbox" id="checkall"/>
      全选 </td>
    <td colspan="9" style="text-align:left;padding-left:20px;"><a href="javascript:DelSelect()" class="button border-red icon-trash-o" style="padding:5px 15px;" onclick="DelSelect()"> 删除</a>
  </table>

</div>

<script type="text/javascript">
function del(id,mid){
	if(confirm("您确定要删除吗?")){

	}else{
	    return false;
    }
}

//全选
$("#checkall").click(function(){
    $("input[name='id[]']").each(function(){
        if (this.checked) {
            this.checked = false;
        }
        else {
            this.checked = true;
        }
    });
})

//批量删除
$(".button").click(function(){
    var arr=[];
    $(".brand_id").each(function (index,object) {
        if($(object).prop("checked")){
            arr.push($(object).val());
        }
    })

    if(arr.length>0){
        if(confirm("确认删除吗？")){
            location.href="all_del?id="+arr.join(",");
        }
    }
})
</script>

</div>
<{$arr|raw}>
</body></html>